Tighten error matching, improve login context handling, and tests#281
Merged
leggetter merged 3 commits intofix/mcp-not-logged-in-errorfrom Apr 1, 2026
Merged
Conversation
- tool_projects_errors.go: match "status code: 4xx" instead of bare "401"/"403" to avoid false positives on IDs or timestamps - tool_login.go: remove `_ = ctx` suppression, add TODO for context propagation to polling goroutine, document happens-before on loginState.err via channel close - root.go: add maintenance comment linking flagNeedsNextArg to init() - helpers.go: revert unrelated Attempt struct alignment change https://claude.ai/code/session_01EpXZqTmgybtjgmSALukH8d
- projects.go: use checkAndPrintError instead of manual status check so ListProjects errors are structured *APIError — the errors.As path in shouldSuggestReauthAfterListProjectsFailure now matches directly - tool_projects_errors_test.go: unit tests for reauth hint logic covering APIError 401/403, plain error fallback, and false-positive resistance - root_argv_test.go: document boolean-flag-between-subcommands limitation https://claude.ai/code/session_01EpXZqTmgybtjgmSALukH8d
Thread the request context into the login polling goroutine so it stops promptly when the MCP transport closes, instead of running for up to ~4 minutes after the client disconnects. WaitForAPIKey blocks with time.Sleep and doesn't accept a context, so we run it in an inner goroutine and select on both its result channel and ctx.Done(). The inner goroutine is bounded by loginMaxAttempts. https://claude.ai/code/session_01EpXZqTmgybtjgmSALukH8d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.